/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.ccut.saturn.component.impl;

import edu.ccut.saturn.component.IBundleAuthorityInfo;
import edu.ccut.saturn.component.IBundleComponentInfo;
import edu.ccut.saturn.component.IBundleDataInfo;
import edu.ccut.saturn.component.IBundleInfo;
import edu.ccut.saturn.component.IBundleSCAInfo;
import edu.ccut.saturn.component.IBundleValidateInfo;
import edu.ccut.saturn.component.IBundleWorkFlowInfo;
import edu.ccut.saturn.component.IDatabaseConfigInfo;
import edu.ccut.saturn.component.ILogger;
import edu.ccut.saturn.component.IMenuInfo;
import edu.ccut.saturn.component.SaturnLoggerManager;


/**
 * {@link IBundleInfo} implementation
 * 
 * @see IBundleInfo
 * @author LeslieGu
 */
public class SaturnBundleInfo implements IBundleInfo {

	private static final String LOGGER_KEY_LOAD_BUNDLE = SaturnLoggerManager.LOGGER_KEY_LOAD_BUNDLE;

	protected static ILogger logger = SaturnLoggerManager.getInstance()
			.getSaturnLogger(LOGGER_KEY_LOAD_BUNDLE);

	private String bundlesSymbolicName;

	private String webRootPath = null;

	private IBundleComponentInfo bundleComopnentInfo = null;

	private IBundleDataInfo bundleDataInfo = null;

	private IBundleSCAInfo bundleSCAInfo = null;

	private IBundleValidateInfo bundleValidateInfo = null;

	private IBundleWorkFlowInfo bundleWorkFlowInfo = null;

	private IBundleAuthorityInfo bundleAuthorityInfo = null;

	private IMenuInfo menuInfo = null;

	private IDatabaseConfigInfo dbConfigInfo = null;
	
	private SaturnBundleFilterInfo filterInfo = null;

	public SaturnBundleInfo(String bundlesSymbolicName) {
		this.bundlesSymbolicName = bundlesSymbolicName;
		this.bundleComopnentInfo = new SaturnBundleComponentInfo(
				bundlesSymbolicName);

		this.bundleDataInfo = new SaturnBundleDataInfo(bundlesSymbolicName);
		this.bundleSCAInfo = new SaturnBundleSCAInfo(bundlesSymbolicName);
		this.bundleValidateInfo = new SaturnBundleValidateInfo(
				bundlesSymbolicName);

		this.bundleWorkFlowInfo = new SaturnBundleWorkFlowInfo(
				bundlesSymbolicName);
		this.bundleAuthorityInfo = new SaturnBundleAuthorityInfo(
				bundlesSymbolicName);
		this.menuInfo = new SaturnMenuInfo(bundlesSymbolicName);
		
		this.filterInfo = new SaturnBundleFilterInfo(bundlesSymbolicName);
	}

	public IBundleComponentInfo getBundleComopnentInfo() {
		return this.bundleComopnentInfo;
	}

	public String getBundleSymbolicName() {
		return this.bundlesSymbolicName;
	}

	public String getWebRootPath() {
		return webRootPath;
	}

	public void setWebRootPath(String webRootPath) {
		this.webRootPath = webRootPath;
	}

	public IBundleDataInfo getBundleDataInfo() {
		return this.bundleDataInfo;
	}

	public IBundleSCAInfo getBundleSCAInfo() {
		return this.bundleSCAInfo;
	}

	public IBundleValidateInfo getBundleValidateInfo() {
		return bundleValidateInfo;
	}

	public IBundleWorkFlowInfo getBundleWorkFlowInfo() {
		return this.bundleWorkFlowInfo;
	}

	public IBundleAuthorityInfo getBundleAuthorityInfo() {
		return this.bundleAuthorityInfo;
	}

	public IMenuInfo getBundleMenuInfo() {
		return this.menuInfo;
	}

	public IDatabaseConfigInfo getBundleDatabaseInfo() {
		return this.dbConfigInfo;
	}
	
	public SaturnBundleFilterInfo getBundleFilterInfo() {
		return this.filterInfo;
	}

	public void setBundleDataBaseInfo(IDatabaseConfigInfo databaseConfigInfo) {
		this.dbConfigInfo = databaseConfigInfo;
	}
}
